package com.liang.pcc.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ProcedureMapper {
    @Select("CALL UpdateDevice1IndependentlyMountable()")
    void callUpdateDevice1Procedure();

    @Select("CALL UpdateAllParentIds(#{userId}, #{fileId})")
    void insertTopologyData(Long fileId, Long userId);

    @Select("CALL UpdateTopologyData()")
    void updateTopologyData();

    /**
     * 母线表计算完独立可装后同步数据，再计算短路电流校验
     */
    @Select("CALL SyncShortCircuitData(#{userId}, #{fileId})")
    void syncShortCircuitData(Long userId, Long fileId);

    @Select("CALL SyncVoltageDeviationCheck(#{userId}, #{fileId})")
    void SyncVoltageDeviationCheck(Long userId, Long fileId);

    @Select("CALL SyncAndEvaluateAll(#{userId}, #{fileId})")
    void SyncAndEvaluateAll(Long userId, Long fileId);

    @Select("CALL FixIndependentlyMountable(#{fileId})")
    void FixIndependentlyMountable(Long fileId);

    @Select("CALL BatchUpdateEquipmentStats(#{fileId})")
    void BatchUpdateEquipmentStats(Long fileId);
}